package com.pgeg.registry;

import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import static com.pgeg.listener.WeaponsListener.*;
import static com.pgeg.util.Reference.MODID;

public class WeaponsRegistry {

    public static void registerWeapon() {

        /*Swords*/
        initWeapons("orichalcum_sword", ORICHALCUM_SWORD);
        initWeapons("saturnium_sword", SATURNIUM_SWORD);
        initWeapons("brimstone_sword", BRIMSTONE_SWORD);
        initWeapons("meteorite_sword", METEORITE_SWORD);
        initWeapons("mithril_sword", MITHRIL_SWORD);
        initWeapons("scythe_dark", SCYTHE_DARK);
        initWeapons("copper_sword", COPPER_SWORD);
        initWeapons("silver_sword", SILVER_SWORD);
        initWeapons("sandstone_sword", SANDSTONE_SWORD);
        initWeapons("redstone_sword", REDSTONE_SWORD);

        /*Katanas*/
        initWeapons("katana_diamond", KATANA_DIAMOND);
        initWeapons("katana_gold", KATANA_GOLD);
        initWeapons("katana_iron", KATANA_IRON);
        initWeapons("katana_netherite", KATANA_NETHERITE);
        initWeapons("katana_stone", KATANA_STONE);
        initWeapons("katana_wood", KATANA_WOOD);

        /*BattleAxes*/
        initWeapons("battle_axe_diamond", BATTLE_AXE_DIAMOND);
        initWeapons("battle_axe_gold", BATTLE_AXE_GOLD);
        initWeapons("battle_axe_iron", BATTLE_AXE_IRON);
        initWeapons("battle_axe_netherite", BATTLE_AXE_NETHERITE);
        initWeapons("battle_axe_stone", BATTLE_AXE_STONE);
        initWeapons("battle_axe_wood", BATTLE_AXE_WOOD);

        /*Daggers*/
        initWeapons( "dagger_diamond", DAGGER_DIAMOND);
        initWeapons("dagger_gold", DAGGER_GOLD);
        initWeapons("dagger_iron", DAGGER_IRON);
        initWeapons("dagger_netherite", DAGGER_NETHERITE);
        initWeapons("dagger_stone", DAGGER_STONE);
        initWeapons("dagger_wood", DAGGER_WOOD);

        /*LongSwords*/
        initWeapons("longsword_diamond", LONGSWORD_DIAMOND);
        initWeapons("longsword_gold", LONGSWORD_GOLD);
        initWeapons("longsword_iron", LONGSWORD_IRON);
        initWeapons("longsword_netherite", LONGSWORD_NETHERITE);
        initWeapons("longsword_stone", LONGSWORD_STONE);
        initWeapons("longsword_wood", LONGSWORD_WOOD);

        /*Rapiers*/
        initWeapons("rapier_diamond", RAPIER_DIAMOND);
        initWeapons("rapier_gold", RAPIER_GOLD);
        initWeapons("rapier_iron", RAPIER_IRON);
        initWeapons("rapier_netherite", RAPIER_NETHERITE);
        initWeapons("rapier_stone", RAPIER_STONE);
        initWeapons("rapier_wood", RAPIER_WOOD);
    }

    private static void initWeapons(String path, Item item) {
        Registry.register(Registry.ITEM, new Identifier(MODID, path), item);
    }
}
